package com.model;

// default package

import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Transient;

/**
 * Programming entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "db_programming", catalog = "acmctgu")
public class Programming implements java.io.Serializable {

    // Fields

    @Transient
    public String getAnswer() {
        return answer;
    }

    public void setAnswer(String answer) {
        this.answer = answer;
    }

    private Integer id;
    private User user;
    private String title;
    private String content;
    private String inputsample;
    private String outputsample;
    private Integer runtime;
    private Integer runtimeforjava;
    private Integer score;
    private String inputdata;
    private String outputdata;
    private String inputdescribe;
    private String outputdescribe;
    private String visible;
    private Integer memoryforc;
    private Integer memoryforjava;
    private Set<Proanswer> proanswers = new HashSet<Proanswer>(0);

    private String prefix;
    private String postfix;

    private String answer; // 不与数据库映射

    // Constructors

    /** default constructor */
    public Programming() {
    }

    // Property accessors

    @Id
    @GeneratedValue
    @Column(name = "id", unique = true, nullable = false)
    public Integer getId() {
        return this.id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "createid", nullable = false)
    public User getUser() {
        return this.user;
    }

    public void setUser(User user) {
        this.user = user;
    }

    @Column(name = "title", nullable = false, length = 50)
    public String getTitle() {
        return this.title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    @Column(name = "content", nullable = false)
    public String getContent() {
        return this.content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    @Column(name = "inputsample", nullable = false, length = 500)
    public String getInputsample() {
        return this.inputsample;
    }

    public void setInputsample(String inputsample) {
        this.inputsample = inputsample;
    }

    @Column(name = "outputsample", nullable = false, length = 500)
    public String getOutputsample() {
        return this.outputsample;
    }

    public void setOutputsample(String outputsample) {
        this.outputsample = outputsample;
    }

    @Column(name = "score", nullable = false)
    public Integer getScore() {
        return this.score;
    }

    public void setScore(Integer score) {
        this.score = score;
    }

    @Column(name = "inputdata", nullable = false, length = 200)
    public String getInputdata() {
        return this.inputdata;
    }

    public void setInputdata(String inputdata) {
        this.inputdata = inputdata;
    }

    @Column(name = "outputdata", nullable = false, length = 200)
    public String getOutputdata() {
        return this.outputdata;
    }

    public void setOutputdata(String outputdata) {
        this.outputdata = outputdata;
    }

    @Column(name = "visible", nullable = false, length = 4)
    public String getVisible() {
        return this.visible;
    }

    public void setVisible(String visible) {
        this.visible = visible;
    }

    @Column(name = "inputdescribe", nullable = true, length = 500)
    public String getInputdescribe() {
        return inputdescribe;
    }

    public void setInputdescribe(String inputdescribe) {
        this.inputdescribe = inputdescribe;
    }

    @Column(name = "outputdescribe", nullable = true, length = 500)
    public String getOutputdescribe() {
        return outputdescribe;
    }

    public void setOutputdescribe(String outputdescribe) {
        this.outputdescribe = outputdescribe;
    }

    @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "programming")
    public Set<Proanswer> getProanswers() {
        return this.proanswers;
    }

    public void setProanswers(Set<Proanswer> proanswers) {
        this.proanswers = proanswers;
    }

    @Column(name = "memoryforc", nullable = true, length = 20)
    public Integer getMemoryforc() {
        return memoryforc;
    }

    public void setMemoryforc(Integer memoryforc) {
        this.memoryforc = memoryforc;
    }

    @Column(name = "memoryforjava", nullable = true, length = 20)
    public Integer getMemoryforjava() {
        return memoryforjava;
    }

    public void setMemoryforjava(Integer memoryforjava) {
        this.memoryforjava = memoryforjava;
    }

    @Column(name = "runtime", nullable = true, length = 20)
    public Integer getRuntime() {
        return runtime;
    }

    public void setRuntime(Integer runtime) {
        this.runtime = runtime;
    }

    @Column(name = "runtimeforjava", nullable = true, length = 20)
    public Integer getRuntimeforjava() {
        return runtimeforjava;
    }

    public void setRuntimeforjava(Integer runtimeforjava) {
        this.runtimeforjava = runtimeforjava;
    }

    @Column(name = "prefix", nullable = false)
    public String getPrefix() {
        return this.prefix;
    }

    public void setPrefix(String prefix) {
        this.prefix = prefix;
    }

    @Column(name = "postfix", nullable = false)
    public String getPostfix() {
        return this.postfix;
    }

    public void setPostfix(String postfix) {
        this.postfix = postfix;
    }

}